package com.iplant.ams.service.basicenum.exc;

import com.iplant.base.po.enums.BaseEnum;

/**
 * 异常类型
 *
 * @author femi
 * @CreateTime 2020-1-19 11:09:21
 * @LastEditTime 2023-8-30 11:09:25
 */
public enum EXCUnusualTypes implements BaseEnum {
    /**
     * 默认 固定值
     */
    Default(0, "", ""),
    /**
     * 物料异常
     */
    Material(1, "物料异常", "MEXC"),
    /**
     * 设备故障
     */
    Device(2, "设备故障", "DEXC"),
    /**
     * 质量异常
     */
    Quality(3, "质量异常", "QEXC"),
    /**
     * 工艺异常
     */
    Technology(4, "工艺异常", "TEXC"),

    /**
     * 其他异常
     */
    Other(5, "其他异常", "OEXC");
    private int value;
    private String label;
    private String excCode;

    EXCUnusualTypes(int value, String label, String excCode) {
        this.value = value;
        this.label = label;
        this.excCode = excCode;
    }

    /**
     * 通过 value 的数值获取枚举实例
     *
     * @param val
     * @return
     */
    public static EXCUnusualTypes getEnumType(int val) {
        for (EXCUnusualTypes type : EXCUnusualTypes.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return Default;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    @Override
    public void setValue(int wValue) {
        this.value = wValue;
    }

    @Override
    public void setLabel(String wLabel) {
        this.label = wLabel;
    }

    @Override
    public String getRemark() {
        return null;
    }

    @Override
    public void setRemark(String remark) {

    }

    public String getExcCode() {
        return excCode;
    }

    public void setExcCode(String excCode) {
        this.excCode = excCode;
    }
}
